#ifndef SERIAL_H
#define SERIAL_H

#include <QWidget>
#include <qserialport.h>

namespace Ui {
class Serial;
}

class Serial : public QWidget
{
    Q_OBJECT

public:
    explicit Serial(QWidget *parent = nullptr);
    ~Serial();

    void sendData(QString content);

signals:
    void showSpeechWidget();

public slots:
    bool openPort();
    void closePort();

private slots:
    void readData();
    void sendData();
    void on_btnBackSpeech_clicked();

private:
    Ui::Serial *ui;
    QSerialPort m_port;
    bool m_status;

    void system_init();
};

#endif // SERIAL_H
